#pragma once
#include <stdio.h>
#include <easyx.h>
#include <conio.h>
#include <time.h>
#define NODE_WIDTH 40

typedef struct {
	int x;
	int y;
}node;

enum direction
{
	eUp,
	eDown,
	eLeft,
	eRight
};

void paintGrid();
void paintSnake(node* snake, int n);
node snakeMove(node* snake, int length, int direction);
void changeDirection(enum direction* pD);
node createFood(node* snake, int length);
void paintFood(node food);
bool isGameOver(node* snake, int length);
void reset(node* snake, int* pLength, enum direction* d);